/**
 * 
 */
package com.scpii.universal.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.scpii.universal.hibernate.dao.BaseDao;
import com.scpii.universal.hibernate.entity.AttributeTab;
import com.scpii.universal.hibernate.entity.AttributeValueTab;
import com.scpii.universal.hibernate.entity.CatelogTab;
import com.scpii.universal.hibernate.entity.ClientUserTab;
import com.scpii.universal.hibernate.entity.ContentImgTab;
import com.scpii.universal.hibernate.entity.ContentTab;
import com.scpii.universal.service.AttributeTabService;
import com.scpii.universal.service.AttributeValueTabService;
import com.scpii.universal.service.CatelogTabService;
import com.scpii.universal.service.ContentImgTabService;
import com.scpii.universal.service.ContentTabService;

/**
 * UniversalApi
 * 
 * @author 甘建新 2012-10-14下午04:02:18
 */
public class Export {
	private CatelogTabService catelogTabService;
	private ContentTabService contentTabService;
	private AttributeTabService attributeTabService;
	private AttributeValueTabService attributeValueTabService;
	private ContentImgTabService contentImgTabService;
	private BaseDao baseDao = new BaseDao();

	private String CATELOG_INSERT_SQL = "INSERT INTO CATELOG_TAB("
			+ "INT_CATE_ID" + ",VAR_CATE_NAME" + ",INT_ENTERP_ID"
			+ ",INT_PARENT_CATE_ID" + ",INT_APP_ID" + ",VAR_CATE_IMG_URL"
			+ ",INT_DELETE_SIGN" + ",DAT_UPDATE_DATETIME" + ",INT_HAS_SUB_CATE"
			+ ",VAR_CATE_DESCRIP" + ") VALUES (";
	private String CONTENT_INSERT_SQL = "INSERT INTO CONTENT_TAB("
			+ "INT_CONTENT_ID" + ",VAR_CONTENT_NAME" + ",INT_ENTERP_ID"
			+ ",INT_CATE_ID" + ",INT_APP_ID" + ",VAR_CONTENT_DESCRIPT"
			+ ",DAT_ADD_DATETIME" + ",VAR_CONTENT_IMG_URL" + ",INT_VIEW_COUNT"
			+ ",INT_ACTION" + ",INT_DELETE_SIGN" + ",DAT_UPDATE_DATETIME"
			+ ") VALUES (";
	private String ATTRIBUTE_INSERT_SQL = "INSERT INTO ATTRIBUTE_TAB("
			+ "INT_ATTRI_ID" + ",INT_CATE_ID" + ",VAR_ATTRI_NAME"
			+ ",INT_DELETE_SIGN" + ",DAT_UPDATE_DATETIME" + ") VALUES";
	private String ATTRIBUTE_VALUE_INSERT_SQL = "INSERT INTO ATTRIBUTE_VALUE_TAB("
			+ "INT_ATTRI_VALUE_ID"
			+ ",VAR_ATTRI_VALUE"
			+ ",INT_ATTRI_ID"
			+ ",INT_CONTENT_ID"
			+ ",INT_ATTR_LIST_ID"
			+ ",INT_DELETE_SIGN"
			+ ",DAT_MUDIFY_DATE" + ")VALUES(";
	private String CONTENT_IMG_INSERT_SQL = "INSERT INTO CONTENT_IMG_TAB("
			+ "INT_IMG_ID" + ",INT_CONTENT_ID" + ",VAR_IMG_NAME"
			+ ",VAR_IMG_URL" + ",INT_DELETE_SIGN" + ",DAT_UPDATE_DATETIME"
			+ ",VAR_IMG_DESCRIP" + ") VALUES(";

	/**
	 * 根据企业ID和应用ID，获取所有的分类列表
	 * 
	 * @param enterpId
	 * @param appId
	 * @return
	 * @throws Exception
	 * @author 甘建新 2012-10-15上午09:41:01
	 */
	public List<CatelogTab> getCatelogList(int enterpId, int appId)
			throws Exception {
		Map<String, Object> argsMap = new HashMap<String, Object>();
		argsMap.put("enterpId", enterpId);
		argsMap.put("appId", appId);

		String sql = "SELECT * FROM CATELOG_TAB WHERE INT_ENTERP_ID=:enterpId AND INT_APP_ID=:appId";

		List<CatelogTab> cateList = catelogTabService.sqlGetList(sql, argsMap);

		return cateList;
	}

	/**
	 * 根据企业ID和应用ID和父类ID，获取父类下的分类ID
	 * 
	 * @param enterpId
	 * @param appId
	 * @param parentId
	 * @return
	 * @throws Exception
	 * @author 甘建新 2012-10-15上午09:41:30
	 */
	public List<CatelogTab> getCatelogList(int enterpId, int appId, int parentId)
			throws Exception {
		Map<String, Object> argsMap = new HashMap<String, Object>();
		argsMap.put("enterpId", enterpId);
		argsMap.put("appId", appId);
		argsMap.put("parentId", parentId);

		String sql = "SELECT * FROM CATELOG_TAB WHERE INT_ENTERP_ID=:enterpId AND INT_APP_ID=:appId AND INT_PARENT_CATE_ID=:parentId";

		List<CatelogTab> cateList = catelogTabService.sqlGetList(sql, argsMap);

		return cateList;
	}

	/**
	 * 获取下级分类ID
	 * 
	 * @param parentId
	 * @return
	 * @throws Exception
	 * @author 甘建新 2012-10-15上午09:42:13
	 */
	public List<CatelogTab> getSubCatelogList(int parentId) throws Exception {
		List<CatelogTab> cateList = new ArrayList<CatelogTab>();

		Map<String, Object> argsMap = new HashMap<String, Object>();
		argsMap.put("parentId", parentId);

		String sqls = "SELECT * FROM CATELOG_TAB WHERE ";

		cateList = catelogTabService.sqlGetList("", argsMap);

		return null;
	}

	/**
	 * 根据分类ID，获取分类下的内容列表
	 * 
	 * @param catelogId
	 * @return
	 * @throws Exception
	 * @author 甘建新 2012-10-15上午09:43:14
	 */
	public List<ContentTab> getContentList(int catelogId) throws Exception {
		Map<String, Object> argsMap = new HashMap<String, Object>();
		argsMap.put("catelogId", catelogId);
		String sql = "SELECT * FROM CONTENT_TAB WHERE INT_CATE_ID=:catelogId";

		List<ContentTab> contList = contentTabService.sqlGetList(sql, argsMap);

		return contList;
	}

	/**
	 * 根据分类列表获取分类对应的属性列表
	 * 
	 * @param catelogId
	 * @return
	 * @throws Exception
	 * @author 甘建新 2012-10-15上午09:43:30
	 */
	public List<AttributeTab> getAttributeList(int catelogId) throws Exception {
		Map<String, Object> argsMap = new HashMap<String, Object>();
		argsMap.put("catelogId", catelogId);

		String sql = "SELECT * FROM ATTRIBUTE_TAB WHERE INT_CATE_ID=:catelogId";
		List<AttributeTab> attriList = attributeTabService.sqlGetList(sql,
				argsMap);

		return attriList;
	}

	/**
	 * 根据内容ID，获取属性值列表
	 * 
	 * @param contentId
	 * @return
	 * @throws Exception
	 * @author 甘建新 2012-10-15上午09:43:49
	 */
	public List<AttributeValueTab> getAttributeValueList(int contentId)
			throws Exception {
		Map<String, Object> argsMap = new HashMap<String, Object>();
		argsMap.put("conentId", contentId);

		String sqls = "SELECT * FROM ATTRIBUTE_VALUE_TAB WHERE INT_CONTENT_ID=:contentId";
		List<AttributeValueTab> attriValueList = attributeValueTabService
				.sqlGetList(sqls, argsMap);

		return attriValueList;
	}

	/**
	 * 根据内容ID，获取内容图片列表
	 * 
	 * @param contentId
	 * @return
	 * @throws Exception
	 * @author 甘建新 2012-10-15上午09:44:05
	 */
	public List<ContentImgTab> getContentImgList(int contentId)
			throws Exception {
		Map<String, Object> argsMap = new HashMap<String, Object>();
		argsMap.put("contentId", contentId);

		String sqls = "SELECT * FROM CONTENT_IMG_TAB WHERE INT_CONTENT_ID=:contentId";
		List<ContentImgTab> contentImgList = contentImgTabService.sqlGetList(
				sqls, argsMap);

		return contentImgList;
	}

	// 企业应用的用户信息
	public List<ClientUserTab> getClientUserList() throws Exception {
		return null;
	}

	/**
	 * 
	 * @param enterpId
	 * @param appId
	 * @return
	 * @throws Exception
	 * @author 甘建新 2012-10-15下午03:56:32
	 */
	public Integer[] proCatelogExport(int enterpId, int appId) throws Exception {
		List<CatelogTab> cateList = this.getCatelogList(enterpId, appId);
		// 获取子分类的信息
		if (cateList != null && cateList.size() > 0) {
			for (CatelogTab catelogTab : cateList) {
				List<CatelogTab> subCateList = this
						.getSubCatelogList(catelogTab.getIntCateId());
			}
		}
		return null;
	}

	/**
	 * 处理导出方法
	 * 
	 * @param enterpId
	 * @param appId
	 * @throws Exception
	 * @author 甘建新 2012-10-15上午09:48:18
	 */
	public void proExport(Integer[] cateIds) throws Exception {
		Map<Integer, Integer> attri2AttrValueMap = new HashMap<Integer, Integer>();
		if (cateIds != null && cateIds.length > 0) {
			for (Integer intCateId : cateIds) {
				// 获取分类对应的属性列表SQL
				List<AttributeTab> attrList = this.getAttributeList(intCateId);
				if (attrList != null && attrList.size() > 0) {
					for (AttributeTab attributeTab : attrList) {
						// 获取新的下一个属性ID值
						int newAttrId = baseDao.executeFunction(
								"SELECT ATTRIBUTE_TAB_SEQ.NEXTVAL FROM DUAL",
								null);
						// 设置到新旧对应的Map中
						attri2AttrValueMap.put(attributeTab.getIntAttriId(),
								newAttrId);

						ATTRIBUTE_INSERT_SQL = ATTRIBUTE_INSERT_SQL + "'"
								+ newAttrId + "','" + intCateId + "','"
								+ attributeTab.getVarAttriName() + "','"
								+ attributeTab.getIntDeleteSign() + "','"
								+ attributeTab.getDatUpdateDatetime() + "');";

						System.out.println(ATTRIBUTE_INSERT_SQL);
					}
				}
			}

			for (Integer intCateId : cateIds) {
				// 获取分类下的内容列表
				List<ContentTab> contList = this.getContentList(intCateId);
				if (contList != null && contList.size() > 0) {
					for (ContentTab contentTab : contList) {
						int nextContentId = baseDao.executeFunction(
								"SELECT CONTENT_TAB_SEQ.NEXTVAL FROM DUAL",
								null);
						CONTENT_INSERT_SQL = CONTENT_INSERT_SQL + "'"
								+ nextContentId + ",'"
								+ contentTab.getVarContentName() + "','"
								+ contentTab.getIntEnterpId() + "','"
								+ intCateId + "','" + contentTab.getIntAppId()
								+ "','" + contentTab.getVarContentDescript()
								+ "','" + contentTab.getDatAddDatetime()
								+ "','" + contentTab.getVarContentImgUrl()
								+ "','" + contentTab.getIntViewCount() + "','"
								+ contentTab.getIntAction() + "','"
								+ contentTab.getIntDeleteSign() + "','"
								+ contentTab.getDatUpdateDatetime() + "';";
						int contentId = contentTab.getIntContentId();

						System.out.println(CONTENT_INSERT_SQL);
						// 获取内容对应的图片资源列表
						List<ContentImgTab> contImgList = this
								.getContentImgList(contentId);
						if (contImgList != null && contImgList.size() > 0) {
							for (ContentImgTab contentImgTab : contImgList) {
								CONTENT_IMG_INSERT_SQL = CONTENT_IMG_INSERT_SQL
										+ "CONTENT_IMG_TAB_SEQ.NEXTVAL" + ",'"
										+ nextContentId + "','"
										+ contentImgTab.getVarImgName() + "','"
										+ contentImgTab.getVarImgUrl() + "','"
										+ contentImgTab.getIntDeleteSign()
										+ "','"
										+ contentImgTab.getDatUpdateDatetime()
										+ "','"
										+ contentImgTab.getVarImgDescrip()
										+ "';";
							}
						}
						// 获取内容对应的属性值列表
						List<AttributeValueTab> attrValueList = this
								.getAttributeValueList(contentId);
						if (attrValueList != null && attrValueList.size() > 0) {
							for (AttributeValueTab attributeValueTab : attrValueList) {
								CONTENT_IMG_INSERT_SQL = CONTENT_IMG_INSERT_SQL
										+ "ATTRIBUTE_VALUE_TAB_SEQ.NEXTVAL"
										+ ",'"
										+ attributeValueTab.getVarAttriValue()
										+ "','"
										+ attri2AttrValueMap
												.get(attributeValueTab
														.getIntAttriId())
										+ "','" + nextContentId + "','"
										+ attributeValueTab.getIntAttrListId()
										+ "','"
										+ attributeValueTab.getIntDeleteSign()
										+ "','"
										+ attributeValueTab.getDatMudifyDate()
										+ "';";

								System.out.println(CONTENT_IMG_INSERT_SQL);
							}
						}
					}
				}
			}
		}
	}

	// main入口
	public static void main(String[] args) {
		Integer[] newCates = new Integer[] { 1069, 1068, 1071, 1073, 1072,
				1089, 1107, 1110, 1091, 1098, 1116, 1065, 1070, 1066, 1067,
				1159, 1160, 1161, 1080, 1090, 1092, 1096, 1097, 1099, 1100,
				1101, 1102, 1103, 1104, 1105, 1106, 1108, 1109, 1111, 1074,
				1112, 1113, 1114, 1115, 1117, 1118, 1119, 1162, 1192 };
		
		Map<Integer, Integer> idsMap = new HashMap<Integer, Integer>();
		idsMap.put(1069, 2152);
		idsMap.put(1068, 2153);
		idsMap.put(1071, 2154);
		idsMap.put(1073, 2155);
		idsMap.put(1072, 2156);
		idsMap.put(1089, 2157);
		idsMap.put(1107, 2158);
		idsMap.put(1110, 2159);
		idsMap.put(1091, 2160);
		idsMap.put(1098, 2161);
		idsMap.put(1116, 2162);
		idsMap.put(1065, 2163);
		idsMap.put(1070, 2164);
		idsMap.put(1066, 2165);
		idsMap.put(1067, 2166);
		idsMap.put(1159, 2167);
		idsMap.put(1160, 2168);
		idsMap.put(1161, 2169);
		idsMap.put(1080, 2170);
		idsMap.put(1090, 2171);
		idsMap.put(1092, 2172);
		idsMap.put(1096, 2173);
		idsMap.put(1097, 2174);
		idsMap.put(1099, 2175);
		idsMap.put(1100, 2176);
		idsMap.put(1101, 2177);
		idsMap.put(1102, 2178);
		idsMap.put(1103, 2179);
		idsMap.put(1104, 2180);
		idsMap.put(1105, 2181);
		idsMap.put(1106, 2182);
		idsMap.put(1108, 2183);
		idsMap.put(1109, 2184);
		idsMap.put(1111, 2185);
		idsMap.put(1074, 2186);
		idsMap.put(1112, 2187);
		idsMap.put(1113, 2188);
		idsMap.put(1114, 2189);
		idsMap.put(1115, 2190);
		idsMap.put(1117, 2191);
		idsMap.put(1118, 2192);
		idsMap.put(1119, 2193);
		idsMap.put(1162, 2194);
		idsMap.put(1192, 2195);
	
		String str = "Insert into CONTENT_IMG_TAB (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1104,'img_ynzx_1.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/Y5WLAI7NL2W3S5EA.jpg',0,'2012-09-14 15:04:08', EMPTY_CLOB());Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1118,'img_ynzx_1.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/YP09L68WOXDAVPQU.jpg',0,'2012-09-17 17:11:47','');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1107,'201122810239.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/XDOODXFHX1WRCDXT.jpg',0,'2012-09-21 15:15:31', EMPTY_CLOB());Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1107,'201181118057.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/OGFOTKNOJD8TDNYO.jpg',0,'2012-09-21 15:15:31', EMPTY_CLOB());Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1107,'201181118247.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/5PQ3FGAKX9V5ZSA1.jpg',0,'2012-09-21 15:15:31', EMPTY_CLOB());Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1107,'2011228102323.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/TTJ005R79DM9LNWC.jpg',0,'2012-09-21 15:15:31', EMPTY_CLOB());Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1107,'2011228102338.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/8XL3D8XREGTEVNLK.jpg',0,'2012-09-21 15:15:31', EMPTY_CLOB());Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1107,'2011228102353.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/70NHIODPB6TX2ESF.jpg',0,'2012-09-21 15:15:31', EMPTY_CLOB());Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1107,'2011228102428.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/TJORGBPA1VLF7A5Z.jpg',0,'2012-09-21 15:15:31', EMPTY_CLOB());Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1107,'2011228102444.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/HXIHCX4EY56NGPIZ.jpg',0,'2012-09-21 15:15:31', EMPTY_CLOB());Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1108,'领导风采.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/1YQMT59T5EAQ0FVZ.jpg',0,'2012-09-17 16:53:54','领导风采');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1108,'年终总结.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/S7MI8WFG5N5T62QQ.jpg',0,'2012-09-17 16:53:54','年终总结');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1108,'软件事业部.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/U2J0UK6HLP3Y0NDZ.jpg',0,'2012-09-17 16:53:54','软件事业部');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1108,'网络部.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/NOLYPBV6SEZMVFYY.jpg',0,'2012-09-17 16:53:54','网络部');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1108,'知识产权部.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/RTPXMG1M39Q9EOG3.jpg',0,'2012-09-17 16:53:54','知识产权部');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1108,'资金部.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/C9AD6IDRIYUYEZ76.jpg',0,'2012-09-17 16:53:54','资金部');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1068,'400案例01.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/C543MTG7H4UG9VLI.jpg',0,'2012-09-24 16:01:55','案例1');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1068,'400案例02.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/D6HZKCY57EFHK3RS.jpg',0,'2012-09-24 16:01:55','案例2');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1068,'400案例03.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/6REOQKUY4G8Q96UQ.jpg',0,'2012-09-24 16:01:55','案例3	');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1068,'400案例04.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/Q008ZJNL0EW7T0R7.jpg',0,'2012-09-24 16:01:55','案例4');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1068,'400案例05.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/VF350O07S6900RU9.jpg',0,'2012-09-24 16:01:55','案例5');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1068,'400案例06.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/OUXF5A4MQC0G6573.jpg',0,'2012-09-24 16:01:55','案例6');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1065,'案例００２.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/3WJ338Q1JY7AL3NH.jpg',0,'2012-09-25 15:01:01','	');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1065,'案例００３.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/8SD7GOHBDRA66KMJ.jpg',0,'2012-09-25 15:01:01','');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1065,'案例００４.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/N8YHP9AJQATJVTM9.jpg',0,'2012-09-25 15:01:01','	');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1065,'案例００１.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/91RXBEVFMF8ITLKJ.jpg',0,'2012-09-25 15:01:01','	');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1067,'南充企业ERP系统.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/FIIDW8YZV3N38TOC.jpg',0,'2012-09-25 14:53:30','南充企业ERP系统	');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1067,'深圳企业定制的ERP系统案例.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/8FU5W4AJSUY05AL6.jpg',0,'2012-09-25 14:53:30','深圳企业定制的ERP系统案例');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1067,'四川月饼糕点CRM管理系统.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/VCONEZ3JG5469SFR.jpg',0,'2012-09-25 14:53:30','四川月饼糕点CRM管理系统');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1073,'成都顶呱呱网络技术有限公司（01）.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/G0KXD1YWR9XK206B.jpg',0,'2012-09-21 09:37:04','成都顶呱呱网络技术有限公司（01）');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1073,'成都顶呱呱网络技术有限公司（02）.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/C6FRMNFLCI385CN2.jpg',0,'2012-09-21 09:37:04','成都顶呱呱网络技术有限公司（02）');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1073,'成都顶呱呱财务管理有限公司（03）.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/OE9GGQ8L8NNA29IV.jpg',0,'2012-09-21 09:37:04','成都顶呱呱财务管理有限公司（01）');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1073,'成都顶呱呱财务管理有限公司（04）.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/6AFX2009FCXF7WRM.jpg',0,'2012-09-21 09:37:04','成都顶呱呱财务管理有限公司（02）');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1073,'成都顶呱呱信息技术有限公司（05）.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/OAIPSU3G5PCD96PH.jpg',0,'2012-09-21 09:37:04','成都顶呱呱信息技术有限公司（01）');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1073,'成都顶呱呱信息技术有限公司（06）.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/QS1THA5IFJNQN5E8.jpg',0,'2012-09-21 09:37:04','成都顶呱呱信息技术有限公司（02）');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1073,'四川顶峰知识产权代理有限公司（07）.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/KOUW0HGKOGG3NX1H.jpg',0,'2012-09-21 09:37:04','四川顶峰知识产权代理有限公司（01）');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1073,'四川顶峰知识产权代理有限公司（08）.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/ETMLY7VA1GD405VY.jpg',0,'2012-09-21 09:37:04','四川顶峰知识产权代理有限公司（02）');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1107,'办公环境.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/80BQ6DAZCUL064EX.jpg',0,'2012-09-21 15:15:31','办公环境');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1107,'北门办公室过道.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/7NG53FPPMLX2EUV3.jpg',0,'2012-09-21 15:15:31','北门办公室过道	');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1107,'北门分公司形像墙.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/P804SON146QGFT5S.jpg',0,'2012-09-21 15:15:31','北门分公司形像墙	');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1107,'北门时代锋尚外景.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/VYDPGXL4BJ7DME3T.jpg',0,'2012-09-21 15:15:31','北门时代锋尚外景	');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1107,'南门总公司前台.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/AJQS1J3TM52JYDA7.jpg',0,'2012-09-21 15:15:31','南门总公司前台	');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1107,'南门总公司外景.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/VBTVOZYUHXF3UNZ8.jpg',0,'2012-09-21 15:15:31','南门总公司外景	');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1107,'西门分公司形像墙.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/5WG942IFLF750JP9.jpg',0,'2012-09-21 15:15:31','西门分公司形像墙');Insert into EXPORT_TABLE (INT_IMG_ID,INT_CONTENT_ID,VAR_IMG_NAME,VAR_IMG_URL,INT_DELETE_SIGN,DAT_UPDATE_DATETIME,VAR_IMG_DESCRIP) values (CONTENT_IMG_SEQ.NEXTVAL,1107,'西门公司仁和春天外景.jpg','WORKDIR/ENTERPRISE_1051/1084/CATELOG/DETAIL/7ZJSSHPNMLDP7CS9.jpg',0,'2012-09-21 15:15:31','西门公司仁和春天外景	');";
		
		for (Integer integer : newCates) {
			str = str.replace(integer+"", idsMap.get(integer)+"");
		}
		System.out.println(str);
	}

	// /==========================================================================

	public void setCatelogTabService(CatelogTabService catelogTabService) {
		this.catelogTabService = catelogTabService;
	}

	public void setContentTabService(ContentTabService contentTabService) {
		this.contentTabService = contentTabService;
	}

	public void setAttributeTabService(AttributeTabService attributeTabService) {
		this.attributeTabService = attributeTabService;
	}

	public void setAttributeValueTabService(
			AttributeValueTabService attributeValueTabService) {
		this.attributeValueTabService = attributeValueTabService;
	}

	public void setContentImgTabService(
			ContentImgTabService contentImgTabService) {
		this.contentImgTabService = contentImgTabService;
	}
}
